<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>审核页面</title>
    <link rel="stylesheet" href="/main/css/style.css">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
    <script src="/main/js/jquery-1.12.3.min.js"></script>

</head>
<body>
<!--fixed remove-->
<section class="fixed" style="z-index:999;width: 100%;height: 100%;background-color: #000;position: fixed;left: 0;top: 0;"></section>
<!--审核页面-->
<div class="verify_page page_item">
    <div class="header clearfix">
        <div class="c_left">
            <img src="{%$user.headimg|default:'/main/img/avator.jpg'%}">
        </div>
        <div class="c_right">
            <p class="title">{%$user.username|default:''%}</p>
            <p class="desc">
               <span>兑换积分:<em>{%$user.intergtal|default:0%}</em></span></p>
        </div>
    </div>
    <!--切换-->
    <div class="mainTab">
        <div class="main-tab-nav">
            <ul class="clearfix">
                <li state="-1" class="current">全部</li>
                <li state="0">审核中</li>
                <li  state="3">通过</li>
                <li state="2">未通过</li>
            </ul>
        </div>
        <div class="main-tab-con">
            <div class="cnt all">
                <!--第一个状态--全部-->
                <ul id="body" class="list_item"></ul>
            </div>

        </div>
    </div>
    <p class="tips">上传图片会在上传成功5个工作日内审核</p>
</div>
</body>
<script src="/main/js/jquery-1.12.3.min.js"></script>
<script src="/main/js/common.js"></script>
<script src="/js/jquery.base64.js"></script>
<script src="/main/js/jquery.touchSwipe.js"></script>
<script>
    var page=1;
    var state=-1;

    $(window).load(function () {
        checkweichatevent();
        createview();
        initevent();

    });
    function initevent() {
        $('.main-tab-nav ul li').click(function(){
            $(this).addClass('current').siblings().removeClass('current');
            page=1;
            state=$(this).attr('state');
            $("#body").empty();
            createview();

        });
        $("body").swipe({
                //Generic swipe handler for all directions
                swipe: function (event, direction, distance, duration, fingerCount, fingerData) {

                    if (direction == 'up') {

                        createview();
                    }
                },
                allowPageScroll: 'vertical',
            }
        );
    }
    function createview() {
           $.ajax({
                type: "POST",
                url: "/api/getsharelist.json",
                data: {page:page,state:state},
                success: function (e) {
                    page= e.page;
                    $.each(e.data, function (k, v) {
                        var li = '';
                        li = li + '<li class="clearfix">';
                        li = li + '<div class="wrap_top clearfix">';
                        li = li + '<div class="c_left"><img src="/upload/thumb/' + v.media + '"> </div>';

                        if (v.state == 3) {
                            li = li + '<div class="c_right">';
                            li = li + '<p class="score">积分+' + v.integral + '</p>';
                        } else {
                            li = li + '<div class="c_right failed">';
                            if (v.rank == null) {
                                li = li + '<p class="score"></p>';
                            } else {
                                li = li + '<p class="score">' + v.rank + '</p>';
                            }

                        }

                        if (v.state == 1) {
                            li = li + '<div class="states"><span class="no_pass">上传失败</span><span class="no_pass">审核未通过</span></div>';
                        } else if (v.state == 2) {
                            li = li + '<div class="states"><span>上传成功</span><span class="no_pass">审核未通过</span></div>';
                        } else if (v.state == 3) {
                            li = li + '<div class="states"><span>上传成功</span><span>审核通过</span></div>';
                        } else {
                            li = li + '<div class="states"><span>审核中</span></div>';
                        }

                        li = li + '</div></div>';
                        li = li + '    <div class="wrap_bottom">上传时间：' + v.createtime + '</div></li>';

                        $("#body").append(li);
                    })


                },



            });

    }


</script>
</html>